{% load i18n static %}

{% if cl.search_fields %}
    <form role="search" id="changelist-search" action="" method="get">
        <div class="input-group">
            <input type="text" class="form-control search-query" placeholder="{% trans 'Search' %}" size="25" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" />
            <span class="input-group-btn">
                <button type="submit" class="btn btn-primary">
                    <span class="mdi mdi-magnify" aria-hidden="true"></span>
                </button>
            </span>
        </div>
        {% for pair in cl.params.items %}
            {% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endif %}
        {% endfor %}
    </form>
    <script type="text/javascript">document.getElementById("searchbar").focus();</script>
{% endif %}
